<template>
  <div class="popup" v-show="showMask">
    <div class="dialog-container">
      <img class="img" src="/static/images/tree-bg.jpg" alt="">
      <div class="dialog-title active">荟同交流日</div>
      <div class="dialog-title">我们会在深圳荟同交流中心不定期举办“荟同交流日”，介绍学校理念、团队、课程、建筑等。诚邀您前来与荟同团队面对面交流。</div>
      <div class="dialog-content-title active">Parents Information Events</div>
      <div class="dialog-content">We will hold Parent Information Events at Whittle Information Center to introduce our vision, faculty, courses and architecture. Please join us tolearn more about our program and meet ourexceptional team.</div>
      <div class="btns">
        <div v-if="type != 'confirm'" class="default-btn" @click="closeBtn">
          <img class="close" src="/static/images/close.png" alt="">
        </div>
      </div>
      <div class="close-btn" @click="closeMask"></div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    value: {},
    // 类型包括 defalut 默认， danger 危险， confirm 确认，
    type: {
      type: String,
      default: 'default'
    },
    content: {
      type: String,
      default: ''
    },
    title: {
      type: String,
      default: ''
    },
    cancelText: {
      type: String,
      default: ''
    }
  },
  data(){
    return{
      showMask: false,
    }
  },
  methods:{
    closeMask(){
      this.showMask = false;
    },
    closeBtn(){
      this.$emit('cancel');
      this.closeMask();
    }
  },
  mounted(){
    this.showMask = this.value;
  },
  watch:{
    value(newVal, oldVal){
      this.showMask = newVal;
    },
    showMask(val) {
      this.$emit('input', val);
    }
  }
}
</script>
<style lang="less">
.popup{
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 101;
  .dialog-container{
    width: 12.625rem;
    height: 19.5rem;
    background: #ffffff;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    position: relative;
    z-index: 100;
    .img{
      width: 100%;
      height: 30%;
    }
    .dialog-title{
      width: 100%;
      height: 1.2rem;
      font-size: .56rem;
      color: #696969;
      font-weight: 600;
      padding: .32rem 1rem 0 .4rem;
      box-sizing: border-box;
    }
    .dialog-content-title{
      width: 100%;
      height: 1.2rem;
      font-size: .56rem;
      color: #696969;
      font-weight: 600;
      padding: .32rem 1rem 0 20px;
      box-sizing: border-box;
      position: absolute;
      top: 12rem;
    }
    .dialog-content{
      width: 100%;
      height: 1.2rem;
      font-size: .56rem;
      color: #696969;
      font-weight: 600;
      padding: .32rem 1rem 0 20px;
      box-sizing: border-box;
      position: absolute;
      top: 13rem;
    }
    .active{
      color: #de7a62;
    }
    .content{
      color: #797979;
      line-height: .52rem;
      padding: 0 .4rem;
      box-sizing: border-box;
    }
    .btns{
      width: 100%;
      height: 1.2rem;
      // line-height: 60px;
      position: absolute;
      bottom: 0;
      left: 0;
      text-align: right;
      padding: 0 .32rem;
      box-sizing: border-box;
      & > div{
        display: inline-block;
        height: .8rem;
        line-height: .8rem;
        padding: 0 .28rem;
        color: #ffffff;
        background: #f1f1f1;
        border-radius: 8px;
        margin-right: .24rem;
        cursor: pointer;
      }
      .default-btn{
        background: none;
        position: absolute;
        right: 10.5rem;
        bottom: 18rem;
        .close{
          width: .8rem;
          height: .8rem;
        }
        &:hover{
          color: #509EE3; 
        }
      }
    }
  }
}
</style>